package com.itheima.api.integer.demo01;

import java.util.Arrays;

public class Demo02 {

    public static void main(String[] args) {

        String s = "91 27 46 38 50";

        String[] strArr = s.split(" ");

        int[] arr = new int[strArr.length];

        for (int i = 0; i < strArr.length; i++) {

            String s1 = strArr[i];
            int i1 = Integer.parseInt(s1);

            arr[i] = i1;
        }

        Arrays.sort(arr);

        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < arr.length; i++) {
            if (i == arr.length - 1){
                sb.append(arr[i]);
            } else {
                sb.append(arr[i]).append(" ");
            }
        }

        String s1 = sb.toString();
        System.out.println(s1);
    }
}
